package com.hshit.downloader;

import android.content.Context;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.Volley;
import com.hshit.downloader.utils.BitmapLruCache;

public class SessionData {
    private RequestQueue requestQueue;
    private ImageLoader imageLoader;
    private static SessionData instance;

    private Context context;
    private SessionData(Context context) {
        this.context = context;
        requestQueue = Volley.newRequestQueue(this.context);
        imageLoader = new ImageLoader(requestQueue, new BitmapLruCache(
                BitmapLruCache.getDefaultLruCacheSize()));
    }

    public static SessionData getInstance(Context context) {
        if (instance == null) {
            instance = new SessionData(context);
        }
        return instance;
    }

    public ImageLoader getImageLoader() {
        return imageLoader;
    }
}
